package com.publish.file.common;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {
	private static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

	/**
	 * @param time 延期多久
	 * @return 距离目标时间的日期
	 */
	public static Date after(Long time) {
		Date sysDate = new Date();
		Long afterTimeLong = sysDate.getTime() + time;
		sysDate.setTime(afterTimeLong);
		return sysDate;
	}

	/**
	 * 统一格式化时间
	 * 
	 * @param time
	 * @return
	 */
	public static String formatDate(long time) {
		Date date = new Date(time);
		return simpleDateFormat.format(date);
	}

	/**
	 * 获取时间戳
	 * 
	 * @return
	 */
	public static long getTime() {
		return new Date().getTime();
	}

}
